<template>
	<section id="zxDetail">
		<HeaDer :Title='titleData'></HeaDer>
		<section class="zxCont">
			<h2 >{{getDatas.title}}</h2>
			<div v-html="getDatas.content" class="conts"></div>
		</section>
	</section>
</template>
<script>
	import HeaDer from "../common/header.vue";
	export default {
		data() {
			return {
				titleData: {
					name: '',
					flat: 1
				},
				detasData: {
					id: '', //序号
					what: 0 // 判断是广告还是公告
				},
				getDatas:{}  //后台返回来的数据
			}
		},
		methods: {
			//数据请求函数
			getData() {
				var _this = this;
				var urls = _this.detasData.what == 0 ? _this.$host.News : _this.$host.Notice;  //判断是头条信息还是平台公告
				_this.$http.post(urls, {
					id: _this.detasData.id

				}).then(function(response) {
					_this.getDatas = response.data.data;
				}).catch(function(error) {})
			}
		},
		components: {
			'HeaDer': HeaDer
		},
		created: function() {
			var _this = this;
			_this.detasData.id = _this.$route.query.id;
			_this.detasData.what = _this.$route.query.what;
			_this.getData();
		}

	}
</script>

<style>

</style>